package cloud.oss.upload.api;

import com.baozun.scm.baseservice.message.common.MessageCommond;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;

/**
 * @author guan.xin
 * @title ApiController
 * @description
 * @create 2022-05-24 23:48
 * @since JDK8
 */
@Slf4j
@RestController
@RequestMapping(value = "/api")
public class ApiController {

    @GetMapping(value = "/commond")
    public void command() {
        Class<MessageCommond> clazz = MessageCommond.class;
        List<Field> fields = Arrays.asList(clazz.getDeclaredFields());
        log.info("filed count:{}", fields.size());
        //fields.forEach(e -> log.info("field name:{}, field class:{}", e.getName(), e.getType().getCanonicalName()));
    }
}
